/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package chatroom;

/**
 *
 * @author Caca
 */
import java.io.*;
/*
 * This class defines the different type of messages that will be exchanged between the
 * Clients and the Server. 
 * When talking from a Java Client to a Java Server a lot easier to pass Java objects, no 
 * need to count bytes or to wait for a line feed at the end of the frame
 */

public class ChatMessage implements Serializable {

    public static final long serialVersionUID = 1112122200L;
    
    public static final int JOINGAME = 0, MESSAGE = 1, LOGOUT = 2, MOVES = 3, WIN = 4, AGAIN = 5,ISWRITE=6,ISWRITESTOP=7,
    FULLGAME =8,LOADGAME=9,EXP=10;
    public int type;
    public String message;

    public void setType(int type) {
        this.type = type;
    }

    public void setMessage(String message) {
        this.message = message;
    }

   
    ChatMessage(int type, String message) {
        this.type = type;
        this.message = message;
    }

    // getters
    public int getType() {
        return type;
    }

    public String getMessage() {
        return message;
    }
}
